import java.util.ArrayList;
import java.util.Collection;

public class MyList {
	public static void main(String[] args) {

		Collection<User> users = new ArrayList<>();

		users.add(new User(1l, "Tomek"));
		users.add(new User(2l, "Marek"));
		users.add(new User(3l, "Kamil"));

		System.out.println(users);

		users.add(new User(4l, "Lukasz"));

		System.out.println(users);

		User lukasz = null;
		for (User user : users) {
			if (user.getId().equals(4l))
				lukasz = user;
		}

		System.out.println(lukasz.getName());
		
		
		
		
	}
}
